package com.yangyuhao.haowuyoupin.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import androidx.fragment.app.Fragment;
import com.yangyuhao.haowuyoupin.R;
import com.yangyuhao.haowuyoupin.SettingsActivity;

public class ProfileFragment extends Fragment {
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_profile, container, false);

        // 设置点击事件
        view.findViewById(R.id.purchase_record).setOnClickListener(v -> 
            Toast.makeText(getContext(), "购买记录", Toast.LENGTH_SHORT).show());
        
        view.findViewById(R.id.sell_record).setOnClickListener(v -> 
            Toast.makeText(getContext(), "出售记录", Toast.LENGTH_SHORT).show());
        
        view.findViewById(R.id.rent_record).setOnClickListener(v -> 
            Toast.makeText(getContext(), "租赁记录", Toast.LENGTH_SHORT).show());
        
        view.findViewById(R.id.rent_out_record).setOnClickListener(v -> 
            Toast.makeText(getContext(), "出租记录", Toast.LENGTH_SHORT).show());

        view.findViewById(R.id.settings_button).setOnClickListener(v -> {
            Intent intent = new Intent(getActivity(), SettingsActivity.class);
            startActivity(intent);
        });

        return view;
    }
} 